<?php
function p($arr)
{
	echo "<pre>";
	print_r($arr);
	exit();
}

function ajaxReturn($data)
{
	echo json_encode($data);
	exit();
}

function t($time)
{
	return date('Y-m-d H:i:s',$time);
}

function theme($url = '')
{
	if($url)
	{
		return '/'.$_GET['app'].'/'.$url;
	}else
	{
		return '/'.$_GET['app'];
	}
}

function themePath()
{
	return THEME_PATH;
}

function getServer()
{
	$PHP_SELF=$_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME'];
	$url='http://'.$_SERVER['HTTP_HOST'].substr($PHP_SELF,0,strrpos($PHP_SELF, '/')+1);
	return $url;
}
/**
 * {:theme()}  跳转url    themePath 静态资源路径 
 */